const express = require('express')
const router = express.Router()

const user_handler = require('../router_handler/artcate')

const expressJWT = require('@escook/express-joi')
const { add_cate_schema, delete_cate_schema, update_cate_schema } = require('../schema/user')

router.get('/cates', user_handler.getArticleCates)
router.post('/addCates', expressJWT(add_cate_schema), user_handler.addArticleCates)
router.post('/delCates/:id', expressJWT(delete_cate_schema), user_handler.deleteArticleCates)
router.get('/cates/:id', expressJWT(delete_cate_schema), user_handler.getArticleCatesById)
router.post('/updateCates', expressJWT(update_cate_schema), user_handler.updateArticleCates)

module.exports = router